"""
@作者 = "陈诗"
@email = 3168157154@qq.com
@creative_time = 2025/10/31 17:50
"""


class Student:
    def __init__(self, name, age, score):
        self.name = name
        self.age = age
        self.score = score

    def get_grade(self):
        if self.score >= 90:
            return 'A'
        elif self.score >= 80:
            return 'B'
        elif self.score >= 70:
            return 'C'
        elif self.score >= 60:
            return 'D'
        else:
            return 'F'

    def __str__(self):
        return f"学生姓名:{self.name},年龄:{self.age},成绩:{self.score}, 等级:{self.get_grade()}"


stu1 = Student('张三', 18, 85)
stu2 = Student('李四', 19, 92)

print(stu1)
print(stu2)
